package com.sky.mapper;

import com.sky.entity.DishFlavor;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author luo20
* @description 针对表【dish_flavor(菜品口味关系表)】的数据库操作Mapper
* @createDate 2025-07-07 15:27:30
* @Entity com.sky.entity.DishFlavor
*/
public interface DishFlavorMapper extends BaseMapper<DishFlavor> {
    /**
     * 菜品口味批量插入
     * @param dishFlavorList
     * @return
     */
    Integer saveBatch(@Param("dishFlavorList") List<DishFlavor> dishFlavorList);

    /**
     * 根据菜品id查询菜品口味
     * @param dishId
     * @return
     */
    @Select("select * from dish_flavor where dish_id = #{dishId}")
    List<DishFlavor> getDishFlavorByDishId(@Param("dishId") Long dishId);

    /**
     * 根据菜品id批量删除菜品口味
     * @param dishIds
     * @return
     */
    Long delFlavorByDishIds(@Param("dishIds") List<Long> dishIds);

    /**
     * 根据菜品ids批量查询菜品口是否存在
     * @param ids
     * @return
     */
    Integer getFlavorCountByDishIds(@Param("ids") List<Long> ids);
}




